package com.example.mobile2121606109ycg0428;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText edtTxtMainShow;
    private KeyButton kBtnMainAdd;
    private KeyButton kBtnMainNum3;
    private KeyButton kBtnMainNum1;
    private KeyButton kBtnMainNum2;
    private KeyButton kBtnMainSub;
    private KeyButton kBtnMainNum6;
    private KeyButton kBtnMainNum4;
    private KeyButton kBtnMainNum5;
    private KeyButton kBtnMainMul;
    private KeyButton kBtnMainNum7;
    private KeyButton kBtnMainNum8;
    private KeyButton kBtnMainNum9;
    private KeyButton kBtnMainDiv;
    private KeyButton kBtnMainPoint;
    private KeyButton kBtnMainNum10;
    private KeyButton kBtnMainEqual;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        edtTxtMainShow = (EditText) findViewById(R.id.edtTxtMainShow);
        kBtnMainAdd = (KeyButton) findViewById(R.id.kBtnMainAdd);
        kBtnMainNum3 = (KeyButton) findViewById(R.id.kBtnMainNum3);
        kBtnMainNum1 = (KeyButton) findViewById(R.id.kBtnMainNum1);
        kBtnMainNum2 = (KeyButton) findViewById(R.id.kBtnMainNum2);
        kBtnMainSub = (KeyButton) findViewById(R.id.kBtnMainSub);
        kBtnMainNum6 = (KeyButton) findViewById(R.id.kBtnMainNum6);
        kBtnMainNum4 = (KeyButton) findViewById(R.id.kBtnMainNum4);
        kBtnMainNum5 = (KeyButton) findViewById(R.id.kBtnMainNum5);
        kBtnMainMul = (KeyButton) findViewById(R.id.kBtnMainMul);
        kBtnMainNum7 = (KeyButton) findViewById(R.id.kBtnMainNum7);
        kBtnMainNum8 = (KeyButton) findViewById(R.id.kBtnMainNum8);
        kBtnMainNum9 = (KeyButton) findViewById(R.id.kBtnMainNum9);
        kBtnMainDiv = (KeyButton) findViewById(R.id.kBtnMainDiv);
        kBtnMainPoint = (KeyButton) findViewById(R.id.kBtnMainPoint);
        kBtnMainNum10 = (KeyButton) findViewById(R.id.kBtnMainNum10);
        kBtnMainEqual = (KeyButton) findViewById(R.id.kBtnMainEqual);
    }

    @Override
    public void onClick(View view) {
        kBtnMainNum1.setOnClickListener(this);
        kBtnMainNum2.setOnClickListener(this);
        kBtnMainNum3.setOnClickListener(this);
        kBtnMainNum4.setOnClickListener(this);
        kBtnMainNum5.setOnClickListener(this);
        kBtnMainNum6.setOnClickListener(this);
        kBtnMainNum7.setOnClickListener(this);
        kBtnMainNum8.setOnClickListener(this);
        kBtnMainNum9.setOnClickListener(this);
        kBtnMainNum10.setOnClickListener(this);
        kBtnMainEqual.setOnClickListener(this);
        kBtnMainAdd.setOnClickListener(this);
        kBtnMainPoint.setOnClickListener(this);
        kBtnMainSub.setOnClickListener(this);
        kBtnMainDiv.setOnClickListener(this);
        kBtnMainMul.setOnClickListener(this);
    }
}